﻿@model Model.VenderUser
@{
    ViewBag.Title = "修改密码";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@section JQscriptSection{
      <script src="../../Scripts/viewsScript/Common/MyDialog.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            $('#loginOut').click(function () {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
                    if (r) {
                        $.ajax({
                            type: "POST",
                            url: '@Url.Action("LogOut", "Account")',
                            success: function (data) {
                                location.href = '@Url.Action("LogOn", "Account")';
                            }
                        });
                    }
                });
            });

            //提交
            $("#btnSave").click(function () {
                var pwd = $.trim($("#Password").attr("value"));
                var pwd1 = $.trim($("#NewPassword").attr("value"));
                var pwd2 = $.trim($("#NewPasswordCfm").attr("value"));
                if (pwd == "")
                {
                    $.messager.alert('提示', '旧密码不能为空', 'warning');
                    return false;
                }
                if (pwd1 == "" || pwd2 == "") {
                    $.messager.alert('提示', '新密码不能为空', 'warning');
                    return false;
                }
                if (pwd1.length < 6 || pwd2.length < 6) {
                    $.messager.alert('提示', '密码长度不能小于6位', 'warning');
                    return false;
                }
                if (pwd1.length > 15 || pwd2.length > 15) {
                    $.messager.alert('提示', '密码长度不能超过20位','warning');
                    return false;
                }
                var form = $('#queryform');
                form.form('submit', {
                    url: '@Url.Content("~/User/ChangePwd")',
                    success: function (data) {
                        eval('data=' + data);
                        if (data.success) {
                         location.href = '@Url.Action("Index", "Home")';
                     } else {
                         $.messager.alert('错误', data.msg, 'error');
                         //$("#txtUserCode").val("").focus();
                         //alert("保存失败！请检查");
                     }
                  }

            });
        });
    });
</script>
}
<body style="background-color:ButtonFace;font-size:17px" @*onload="InitGrid();"*@>
 <form id="queryform" method="post" action='@Url.Content("~/User/ChangePwd")' >
     <div region="north" split="true" border="false" style="overflow: hidden; height: 51px;
        color: #000000; background: url(../Content/Ext/resources/themes/images/gray/panel-header-default-bottom-bg.gif);
        font-family: Verdana, 微软雅黑,黑体">
        <span style="float: right; padding-right: 10px; padding-top: 30px;" class="head">欢迎:@Model.USERNAME <a
            href="#" id="loginOut">安全退出</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Home/Index" id="HomeIndex">返回首页</a></span>  
            @*<img src="../../Content/themes/base/images/logo.png" height="50" align="absmiddle" />*@
        </span>
        <span style="padding-left:10px; font-size: 20px; ">
            <img src="/Content/images/blocks.gif" width="20" height="20" align="absmiddle" />
             我厨&reg - 修改密码
        </span>
    </div>
<div  class="easyui-panel" title="修改密码" style="height: 180px; padding: 5px; background: #fafafa;">
   
         
        <label for="TransportNo">旧&nbsp;&nbsp;密&nbsp;&nbsp;码：</label>
        <input id="Password" type="password" name="Password" style="width: 136px;" />
        <br />
        <label for="TransportNo">新&nbsp;&nbsp;密&nbsp;&nbsp;码：</label>
        <input id="NewPassword" type="password" name="NewPassword" style="width: 136px;" />
        <br />
        <label for="TransportNo">确认新密码：</label>
        <input  id="NewPasswordCfm" type="password" name="NewPasswordCfm" style="width: 136px;" />
        <br />
      <div style="margin-left: 135px;" ><a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-preview'" onclick="save()">保存</a></div>
</div>
</form>
</body>

